<template>
  <div>
    <!-- <div class="box bc-fff">
      <div class="billImg icon animated fadeIn" :style="{'background-image': 'url('+ 'xxx' +')'}"></div>
    </div> -->
    <!-- <iframe class="billImg" src="http://oo0tnny2b.bkt.clouddn.com/12131321.pdf" frameborder="0"></iframe> -->
    <!-- <a href="http://oo0tnny2b.bkt.clouddn.com/12131321.pdf">http://oo0tnny2b.bkt.clouddn.com/12131321.pdf</a> -->
    <div class="tips">发票信息&nbsp;&nbsp;</div>
    <div class="line-input box box-ac">
      <div>发票代码&nbsp;&nbsp;</div>
      <div class="text box box-ac box-f1">{{invoiceDetail.invoicecode}}</div>
    </div>
    <div class="line-input box box-ac">
      <div>发票号码&nbsp;&nbsp;</div>
      <div class="text box box-ac box-f1">{{invoiceDetail.invoicenum}}</div>
    </div>
    <div class="line-input box box-ac">
      <div>开票日期&nbsp;&nbsp;</div>
      <div class="text box box-ac box-f1">{{invoiceDetail.invoicedate}}</div>
    </div>
    <div class="line-input box box-ac">
      <div>开票金额（不含税）&nbsp;&nbsp;</div>
      <div class="text box box-ac box-f1">{{invoiceDetail.invoiceamount}}</div>
    </div>
    <div class="line-input box box-ac bor-none code-line">
      <div>校验码&nbsp;&nbsp;</div>
      <div class="text box box-ac box-f1">{{invoiceDetail.checkcode}}</div>
    </div>

    <div class="line-input box box-ac">
      <div>发票类型&nbsp;&nbsp;</div>
      <div class="text box box-ac box-f1">{{invoiceDetail.invoicetype | Finvoicetype}}</div>
    </div>
    <div class="line-input box box-ac">
      <div>使用状态&nbsp;&nbsp;</div>
      <div class="text box box-ac box-f1">{{invoiceDetail.usestate==1?'已报销':'未报销'}}</div>
    </div>
    <div class="line-input box box-ac">
      <div>查验结果&nbsp;&nbsp;</div>
      <div class="text box box-ac box-f1">{{invoiceDetail.ckstatus==1?'核验通过':'未核验'}}</div>
    </div>
    <div class="line-input box box-ac bor-none">
      <div>发票抬头&nbsp;&nbsp;</div>
      <div class="text box box-ac box-f1">{{invoiceDetail.salesname}}</div>
    </div>
  </div>
</template>

<script>
import config from '@/js/config'
export default {
  data () {
    return {
      invoiceDetail: {}
    }
  },
  filters: {
    Finvoicetype (invoicetype) {
      return {
        '01': '纸质专票',
        '04': '纸质普票',
        '10': '电子普票'
      }[invoicetype + ''] || ''
    }
  },
  mounted () {
    this.invoiceDetail = this.$store.state.invoiceDetail
    // if (this.invoiceDetail.pdfuuid) this.getPdfUrl()
  },
  methods: {
    getPdfUrl () {
      let _this = this
      _this.$http({
        $vue: _this,
        type: 'XML',
        method: 'post',
        url: config.GXUrl + '/CheckInvoice/services/AutoImageCenter.ws?wsdl',
        data: {
          servername: 'AttrDownUrl',
          data: {
            pdfuud: _this.invoiceDetail.pdfuuid
          }
        }
      }).then(item => {
        console.log(item)
      })
    }
  }
}
</script>

<style lang="scss" scoped>
@import '../css/color';
@import '../css/mixins';
.billImg{
  position: relative;
  border-radius:.2rem;
  width:6.7rem;
  height: 3rem;
  margin: .25rem auto;
  background-color:#DDD;
  @include bg-size(cover);
}
.code-line{
  margin-bottom:.25rem;
}
.tips{
  color:#666;
  padding:.25rem .3rem;
}
</style>
